.class public Lcom/estrongs/android/ui/recycler/DividerDecoration;
.super Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;
.source "DividerDecoration.java"


# instance fields
.field private a:Landroid/graphics/drawable/Drawable;

.field private b:Landroid/graphics/drawable/Drawable;

.field private c:I

.field private d:I

.field private e:Z

.field private f:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    .line 1
    invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;-><init>()V

    const/4 v0, 0x1

    .line 2
    iput v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->d:I

    const/4 v0, 0x0

    .line 3
    iput-boolean v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->e:Z

    .line 4
    iput-object p1, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->f:Landroid/content/Context;

    .line 5
    new-instance v0, Landroid/graphics/drawable/ColorDrawable;

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    const v1, 0x7f060070

    invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getColor(I)I

    move-result p1

    invoke-direct {v0, p1}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    iput-object v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->b:Landroid/graphics/drawable/Drawable;

    .line 6
    iput-object v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    .line 7
    iget p1, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->d:I

    iput p1, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    return-void
.end method


# virtual methods
.method public a(I)V
    .locals 1

    .line 1
    new-instance v0, Landroid/graphics/drawable/ColorDrawable;

    invoke-direct {v0, p1}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V

    iput-object v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    return-void
.end method

.method public a(Z)V
    .locals 0

    .line 2
    iput-boolean p1, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->e:Z

    return-void
.end method

.method public b(I)V
    .locals 1

    if-ltz p1, :cond_0

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->f:Landroid/content/Context;

    int-to-float p1, p1

    invoke-static {v0, p1}, Les/fy;->a(Landroid/content/Context;F)I

    move-result p1

    iput p1, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    :cond_0
    return-void
.end method

.method public getItemOffsets(Landroid/graphics/Rect;Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
    .locals 0

    .line 1
    invoke-virtual {p3, p2}, Landroidx/recyclerview/widget/RecyclerView;->getChildAdapterPosition(Landroid/view/View;)I

    move-result p2

    .line 2
    iget-boolean p3, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->e:Z

    const/4 p4, 0x0

    if-eqz p3, :cond_0

    if-nez p2, :cond_0

    .line 3
    iget p2, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    invoke-virtual {p1, p4, p2, p4, p2}, Landroid/graphics/Rect;->set(IIII)V

    goto :goto_0

    .line 4
    :cond_0
    iget p2, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    invoke-virtual {p1, p4, p4, p4, p2}, Landroid/graphics/Rect;->set(IIII)V

    :goto_0
    return-void
.end method

.method public onDraw(Landroid/graphics/Canvas;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
    .locals 7

    .line 1
    invoke-virtual {p2}, Landroid/view/ViewGroup;->getPaddingLeft()I

    move-result p3

    .line 2
    invoke-virtual {p2}, Landroid/view/ViewGroup;->getWidth()I

    move-result v0

    invoke-virtual {p2}, Landroid/view/ViewGroup;->getPaddingRight()I

    move-result v1

    sub-int/2addr v0, v1

    .line 3
    invoke-virtual {p2}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v1

    const/4 v2, 0x0

    :goto_0
    if-ge v2, v1, :cond_1

    .line 4
    invoke-virtual {p2, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v3

    .line 5
    iget-boolean v4, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->e:Z

    if-eqz v4, :cond_0

    if-nez v2, :cond_0

    .line 6
    iget-object v4, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3}, Landroid/view/View;->getTop()I

    move-result v5

    iget v6, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    sub-int/2addr v5, v6

    invoke-virtual {v3}, Landroid/view/View;->getTop()I

    move-result v6

    invoke-virtual {v4, p3, v5, v0, v6}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 7
    iget-object v4, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v4, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 8
    :cond_0
    invoke-virtual {v3}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v4

    check-cast v4, Landroidx/recyclerview/widget/RecyclerView$LayoutParams;

    .line 9
    invoke-virtual {v3}, Landroid/view/View;->getBottom()I

    move-result v3

    iget v4, v4, Landroid/view/ViewGroup$MarginLayoutParams;->bottomMargin:I

    add-int/2addr v3, v4

    .line 10
    iget v4, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->c:I

    add-int/2addr v4, v3

    .line 11
    iget-object v5, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v5, p3, v3, v0, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 12
    iget-object v3, p0, Lcom/estrongs/android/ui/recycler/DividerDecoration;->a:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_1
    return-void
.end method
